#!/bin/bash
#mysql backup
#for tsf
  BakDir=/var/database_backup/mysql_backup/backup_demo/
  Date=`date +%Y%m%d`
  Passwd='root123456'
  cd $BakDir

if [ ! -d "$Date" ]; then
  mkdir $Date
fi
  cd $Date
    h=`date +%H`
  
 if [ ! -d "$h" ]; then
  mkdir $h
fi
 /usr/bin/mysqldump -u root -p$Passwd  backup_demo demo1 >$h/demo1.sql